<template>
	<div class="custom-form">
		<el-row :gutter="15">
			<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px" :key="showFormKey"
				v-if="showForm">
				<el-col :span="24">
					<el-tabs v-model="tabsValue120" type="" tab-position="top" :style="{pointerEvents:this.isView}">
						<el-tab-pane label="数据产品基本信息" name="tab1" style="pointer-events: auto;">
							<el-form ref='tab11':model="formData" :rules="rules" size="medium" label-width="100px" :key="showFormKey" >
							<el-col :span="24" v-show="hasFormPermission('F_Name')">
								<el-form-item :label="$t('组件名称')" prop="F_Name">
									<el-input v-model="formData['F_Name']" placeholder="请输入组件名称"
										:disabled="hasDisabledPermission('F_Name',false)"
										:readonly="!hasEditPermission('F_Name',false)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_Icon')">
								<el-form-item :label="$t('组件图标')" prop="F_Icon">
									<xjr-custom-upload :config="F_IconConfig"
										:disabled="hasDisabledPermission('F_Icon',false)" v-model="formData['F_Icon']"
										list-type="picture-card"></xjr-custom-upload>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_BriefIntroduction')">
								<el-form-item :label="$t('组件简介')" prop="F_BriefIntroduction">
									<el-input v-model="formData['F_BriefIntroduction']" type="textarea"
										placeholder="请输入组件简介"
										:disabled="hasDisabledPermission('F_BriefIntroduction',false)"
										:readonly="!hasEditPermission('F_BriefIntroduction',false)"
										:autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_ClassHeading')">
								<el-form-item :label="$t('所属类目')" prop="F_ClassHeading">
									<xjr-cascader v-model="formData['F_ClassHeading']"
										:disabled="hasDisabledPermission('F_ClassHeading',false)"
										:settings="F_ClassHeadingsettings" :style="{width: '100%'}"
										placeholder="请选择所属类目" separator="/" :checkStrictly="false" filterable clearable
										v-if="showForm"></xjr-cascader>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_DataSceneClassification')">
								<el-form-item :label="$t('数据产品场景分类')" prop="F_DataSceneClassification">
									<xjr-cascader v-model="formData['F_DataSceneClassification']"
										:disabled="hasDisabledPermission('F_DataSceneClassification',false)"
										:settings="F_DataSceneClassificationsettings" :style="{width: '100%'}"
										placeholder="请选择数据产品场景分类" separator="/" :checkStrictly="false" filterable
										clearable v-if="showForm"></xjr-cascader>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_DataSources')">
								<el-form-item :label="$t('数据来源')" prop="F_DataSources">
									<el-select v-model="formData['F_DataSources']" placeholder="请选择数据来源"
										:disabled="hasDisabledPermission('F_DataSources',false)" filterable clearable
										:style="{width: '100%'}">
										<el-option v-for="(item, index) in F_DataSourcesOptions" :key="index"
											:label="item.F_ItemName" :value="item.F_ItemValue"
											:disabled="item.disabled">
										</el-option>
									</el-select>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_Free')">
								<el-form-item :label="$t('付费类型')" prop="F_Free">
									<el-select v-model="formData['F_Free']" placeholder="请选择付费类型"
										:disabled="hasDisabledPermission('F_Free',false)" filterable clearable
										:style="{width: '100%'}" @change="changeValue($event)">
										<el-option v-for="(item, index) in F_FreeOptions" :key="index"
											:label="item.F_ItemName" :value="item.F_ItemValue"
											:disabled="item.disabled">
										</el-option>
									</el-select>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_PayType')"  v-if="F_PayType1">
								<el-form-item :label="$t('付费方式')" prop="F_PayType">
									<el-radio-group v-model="formData['F_PayType']" size="medium"
										:disabled="hasDisabledPermission('F_PayType',false)"
										:readonly="!hasEditPermission('F_PayType',undefined)">
										<el-radio v-for="(item, index) in F_PayTypeOptions" :key="index"
											:label="item.F_ItemValue" :disabled="item.disabled">{{item.F_ItemName}}
										</el-radio>
									</el-radio-group>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_PriceType')" v-if="F_PriceType1">
								<el-form-item :label="$t('价格类型')" prop="F_PriceType">
									<el-radio-group v-model="formData['F_PriceType']" size="medium"
										:disabled="hasDisabledPermission('F_PriceType',false)"
										:readonly="!hasEditPermission('F_PriceType',undefined)" @change="changeValue2($event)">
										<el-radio v-for="(item, index) in F_PriceTypeOptions" :key="index"
											:label="item.F_ItemValue" :disabled="item.disabled">{{item.F_ItemName}}
										</el-radio>
									</el-radio-group>
								</el-form-item>
							</el-col>
							<el-col :span="12" v-show="hasFormPermission('F_BottomPrice')" v-if="F_BottomPrice1">
								<el-form-item label-width="100px" :label="$t('价格区间')" prop="F_BottomPrice">
									<el-input v-model.number="formData['F_BottomPrice']" type="number"
										placeholder="请输入最高价格" :disabled="hasDisabledPermission('F_BottomPrice',false)"
										:readonly="!hasEditPermission('F_BottomPrice',false)" clearable
										:style="{width: '100%'}">
										<template slot="prepend">¥</template>
									</el-input>
								</el-form-item>
							</el-col>
							<el-col :span="12" v-show="hasFormPermission('F_PeakPrice')" v-if="F_PeakPrice1">
								<el-form-item label-width="32px" :label="$t('--')" prop="F_PeakPrice">
									<el-input v-model.number="formData['F_PeakPrice']" type="number"
										placeholder="请输入最低价格" :disabled="hasDisabledPermission('F_PeakPrice',false)"
										:readonly="!hasEditPermission('F_PeakPrice',false)" clearable
										:style="{width: '100%'}">
										<template slot="prepend">¥</template>
									</el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_DeliveryMethod')">
								<el-form-item :label="$t('交付方式')" prop="F_DeliveryMethod">
									<el-select v-model="formData['F_DeliveryMethod']" placeholder="请选择交付方式"
										:disabled="hasDisabledPermission('F_DeliveryMethod',false)" filterable clearable
										:style="{width: '100%'}">
										<el-option v-for="(item, index) in F_DeliveryMethodOptions" :key="index"
											:label="item.F_ItemName" :value="item.F_ItemValue"
											:disabled="item.disabled">
										</el-option>
									</el-select>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_Versions')">
								<el-form-item :label="$t('数据产品版本')" prop="F_Versions">
									<el-input v-model="formData['F_Versions']" placeholder="请输入数据产品版本"
										:disabled="hasDisabledPermission('F_Versions',false)"
										:readonly="!hasEditPermission('F_Versions',false)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" __isInput__="hasFormPermission('F_UrlType')" v-if="F_UrlType1">
								<el-form-item :label="$t('')" prop="F_UrlType">
									<el-radio-group v-model="formData['F_UrlType']" size="medium"
										:disabled="hasDisabledPermission('F_UrlType',false)"
										:readonly="!hasEditPermission('F_UrlType',false)">
										<el-radio v-for="(item, index) in F_UrlTypeOptions" :key="index"
											:label="item.F_ItemValue" :disabled="item.disabled">{{item.F_ItemName}}
										</el-radio>
									</el-radio-group>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_Url')">
								<el-form-item :label="$t('数据产品试用链接')" prop="F_Url">
									<el-input v-model="formData['F_Url']" placeholder="请输入数据产品试用链接"
										:disabled="hasDisabledPermission('F_Url',false)"
										:readonly="!hasEditPermission('F_Url',false)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_UseRequirement')">
								<el-form-item :label="$t('数据产品使用要求')" prop="F_UseRequirement">
									<el-input v-model="formData['F_UseRequirement']" placeholder="请输入数据产品使用要求"
										:disabled="hasDisabledPermission('F_UseRequirement',false)"
										:readonly="!hasEditPermission('F_UseRequirement',false)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_Status')">
								<el-form-item :label="$t('组件状态')" prop="F_Status">
									<el-select v-model="formData['F_Status']" placeholder="请选择组件状态"
										:disabled="hasDisabledPermission('F_Status',true)" filterable clearable
										:style="{width: '100%'}">
										<el-option v-for="(item, index) in F_StatusOptions" :key="index"
											:label="item.F_ItemName" :value="item.F_ItemValue"
											:disabled="item.disabled"></el-option>
									</el-select>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_CreateDate')">
								<el-form-item :label="$t('组件创建时间')" prop="F_CreateDate">
									<avue-information-body :operationVal="operationVal" infoType='date'
										:whetherToRebindSecondaryEditing='false' v-model="formData['F_CreateDate']"
										placeholder="组件创建时间" :disabled="hasDisabledPermission('F_CreateDate',true)"
										:readonly="!hasEditPermission('F_CreateDate',true)" :style="{width: '100%'}">
									</avue-information-body>
								</el-form-item>
							</el-col>
							</el-form>
						</el-tab-pane>
						<el-tab-pane label="数据产品协议" name="tab2" style="pointer-events: auto;">
							<el-form ref='tab22':model="formData" :rules="rules" size="medium" label-width="100px" :key="showFormKey" >
							<el-col :span="24" v-show="hasFormPermission('F_UserLicenseAgreement')">
								<el-form-item :label="$t('数据产品的用户授权协议')" prop="F_UserLicenseAgreement">
									<xjr-custom-upload :config="F_UserLicenseAgreementConfig"
										:disabled="hasDisabledPermission('F_UserLicenseAgreement',false)"
										v-model="formData['F_UserLicenseAgreement']" list-type="text">
									</xjr-custom-upload>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_ConfidentialityAgreement')">
								<el-form-item :label="$t('数据产品保密协议')" prop="F_ConfidentialityAgreement">
									<xjr-custom-upload :config="F_ConfidentialityAgreementConfig"
										:disabled="hasDisabledPermission('F_ConfidentialityAgreement',false)"
										v-model="formData['F_ConfidentialityAgreement']" list-type="text">
									</xjr-custom-upload>
								</el-form-item>
							</el-col>
							</el-form>
						</el-tab-pane>
						<el-tab-pane label="详细描述" name="tab3" style="pointer-events: auto;">
							<el-form ref='tab33':model="formData" :rules="rules" size="medium" label-width="100px" :key="showFormKey" >
							<el-col :span="24" v-show="hasFormPermission('F_APIDocument')">
								<el-form-item :label="$t('API文档')" prop="F_APIDocument">
									<xjr-custom-upload :config="F_APIDocumentConfig"
										:disabled="hasDisabledPermission('F_APIDocument',false)"
										v-model="formData['F_APIDocument']" list-type="text"></xjr-custom-upload>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_ErrorCodeReference')">
								<el-form-item :label="$t('错误码参照')" prop="F_ErrorCodeReference">
									<xjr-custom-upload :config="F_ErrorCodeReferenceConfig"
										:disabled="hasDisabledPermission('F_ErrorCodeReference',false)"
										v-model="formData['F_ErrorCodeReference']" list-type="text"></xjr-custom-upload>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_ApplicationScenarioAttachment')">
								<el-form-item :label="$t('应用场景介绍')" prop="F_ApplicationScenarioAttachment">
									<xjr-custom-upload :config="F_ApplicationScenarioAttachmentConfig"
										:disabled="hasDisabledPermission('F_ApplicationScenarioAttachment',false)"
										v-model="formData['F_ApplicationScenarioAttachment']" list-type="text">
									</xjr-custom-upload>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_ApplicationScenario')">
								<el-form-item :label="$t('')" prop="F_ApplicationScenario">
									<el-input v-model="formData['F_ApplicationScenario']" type="textarea"
										placeholder="请输入"
										:disabled="hasDisabledPermission('F_ApplicationScenario',false)"
										:readonly="!hasEditPermission('F_ApplicationScenario',false)"
										:autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_CommonProblemAttachment')">
								<el-form-item :label="$t('常见问题')" prop="F_CommonProblemAttachment">
									<xjr-custom-upload :config="F_CommonProblemAttachmentConfig"
										:disabled="hasDisabledPermission('F_CommonProblemAttachment',false)"
										v-model="formData['F_CommonProblemAttachment']" list-type="text">
									</xjr-custom-upload>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_CommonProblem')">
								<el-form-item :label="$t('')" prop="F_CommonProblem">
									<el-input v-model="formData['F_CommonProblem']" type="textarea" placeholder="请输入"
										:disabled="hasDisabledPermission('F_CommonProblem',false)"
										:readonly="!hasEditPermission('F_CommonProblem',false)"
										:autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_CommodityAgreement')">
								<el-form-item :label="$t('商品协议')" prop="F_CommodityAgreement">
									<el-input v-model="formData['F_CommodityAgreement']" type="textarea"
										placeholder="请输入商品协议"
										:disabled="hasDisabledPermission('F_CommodityAgreement',false)"
										:readonly="!hasEditPermission('F_CommodityAgreement',false)"
										:autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							</el-form>
						</el-tab-pane>
						<el-tab-pane label="发布商信息" name="tab4" style="pointer-events: auto;">
							<el-col :span="24" v-show="hasFormPermission('F_publisher')">
								<el-form-item :label="$t('发布商')" prop="F_publisher">
									<el-input v-model="formData['F_publisher']" placeholder="请输入发布商"
										:disabled="hasDisabledPermission('F_publisher',false)"
										:readonly="!hasEditPermission('F_publisher',false)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_publishAddress')">
								<el-form-item :label="$t('地区')" prop="F_publishAddress">
									<avue-select-area v-if="showForm" v-model="formData['F_publishAddress']"
										:clearable="true" :disabled="hasDisabledPermission('F_publishAddress',false)"
										:readonly="!hasEditPermission('F_publishAddress',undefined)"></avue-select-area>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_publishEmail')">
								<el-form-item :label="$t('邮箱')" prop="F_publishEmail">
									<el-input v-model="formData['F_publishEmail']" placeholder="请输入邮箱"
										:disabled="hasDisabledPermission('F_publishEmail',false)"
										:readonly="!hasEditPermission('F_publishEmail',false)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_publishUserName')">
								<el-form-item :label="$t('联系人')" prop="F_publishUserName">
									<el-input v-model="formData['F_publishUserName']" placeholder="请输入联系人"
										:disabled="hasDisabledPermission('F_publishUserName',false)"
										:readonly="!hasEditPermission('F_publishUserName',false)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_publishPhone')">
								<el-form-item :label="$t('联系方式')" prop="F_publishPhone">
									<el-input v-model="formData['F_publishPhone']" placeholder="请输入联系方式"
										:disabled="hasDisabledPermission('F_publishPhone',false)"
										:readonly="!hasEditPermission('F_publishPhone',false)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
						</el-tab-pane>
						<!-- <el-tab-pane label="服务商信息" name="tab5" style="pointer-events: auto;">
							<el-col :span="24" v-show="hasFormPermission('F_ServiceProvider')">
								<el-form-item :label="$t('服务商')" prop="F_ServiceProvider">
									<el-input v-model="formData['F_ServiceProvider']" placeholder="请输入服务商"
										:disabled="hasDisabledPermission('F_ServiceProvider',true)"
										:readonly="!hasEditPermission('F_ServiceProvider',true)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_ServiceAddress')">
								<el-form-item :label="$t('地区')" prop="F_ServiceAddress">
									<avue-select-area v-if="showForm" v-model="formData['F_ServiceAddress']"
										:clearable="true" :disabled="hasDisabledPermission('F_ServiceAddress',true)"
										:readonly="!hasEditPermission('F_ServiceAddress',true)"></avue-select-area>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_ServiceEmail')">
								<el-form-item :label="$t('邮箱')" prop="F_ServiceEmail">
									<el-input v-model="formData['F_ServiceEmail']" placeholder="请输入邮箱"
										:disabled="hasDisabledPermission('F_ServiceEmail',true)"
										:readonly="!hasEditPermission('F_ServiceEmail',true)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_ServiceLinkMan')">
								<el-form-item :label="$t('联系人')" prop="F_ServiceLinkMan">
									<el-input v-model="formData['F_ServiceLinkMan']" placeholder="请输入联系人"
										:disabled="hasDisabledPermission('F_ServiceLinkMan',true)"
										:readonly="!hasEditPermission('F_ServiceLinkMan',true)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_ServicePhone')">
								<el-form-item :label="$t('联系方式')" prop="F_ServicePhone">
									<el-input v-model="formData['F_ServicePhone']" placeholder="请输入联系方式"
										:disabled="hasDisabledPermission('F_ServicePhone',true)"
										:readonly="!hasEditPermission('F_ServicePhone',true)" clearable
										:style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
							<el-col :span="24" v-show="hasFormPermission('F_ProviderProfile')">
								<el-form-item :label="$t('服务商简介')" prop="F_ProviderProfile">
									<el-input v-model="formData['F_ProviderProfile']" type="textarea"
										placeholder="请输入服务商简介"
										:disabled="hasDisabledPermission('F_ProviderProfile',true)"
										:readonly="!hasEditPermission('F_ProviderProfile',true)"
										:autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
								</el-form-item>
							</el-col>
						</el-tab-pane> -->
					</el-tabs>
				</el-col>
				<el-col :span="24">
					<el-form-item size="large" class="form-button-center" v-if="isEdit">
						<el-button type="primary" @click="prevstep" v-show="prevstep1" style="background-color: white;color:black;border-color: #d5d7dc;">
							上一步
						</el-button>
						<el-button type="primary" @click="nextstep"  v-show="nextstep1">
							下一步
						</el-button>
						<el-button type="primary" @click="submitForm" :loading="submitLoading"  v-show="submit1">
							{{submitLoading?$t('workFlow.WFMenu.hintSubmit'):$t('submit')}}
						</el-button>
						<el-button @click="cancelForm">{{$t('cancelText')}}</el-button>
					</el-form-item>
				</el-col>
			</el-form>
		</el-row>
	</div>
</template>
<script>
	import authorizeMixin from "@/mixins/authorize";
	import {
		baseUrl
	} from "@/config/env";
	import request from "@/router/axios";
	import {
		fieldsConfig,
		formFieldsMap,
		getHideComponents
	} from './DataComponentConfig'
	import {
		formValidateNotice
	} from '@/util/util';
	export default {
		mixins: [authorizeMixin],

		components: {},
		props: ['keyValue', 'isEdit', 'disabled','isView'],
		data() {
			return {
				submit1:false,
				prevstep1:false,
				nextstep1:true,
				F_PayType1:true,
				F_PriceType1:true,
				F_BottomPrice1:true,
				F_PeakPrice1:true,
				F_ItemValue1:false,
				userInfo: {},
				submitLoading: false,
				showForm: true,
				isView:'none',
				showFormKey: 1,
				reRenderSubform: false,
				operationVal: 'add',
				isAdd: true,
				addressUrl: 'barinfunctionalsubassembly',
				autoCompleteConfEventData: [],
				mainTableName: 't_barin_functional_subassembly',
				formConfig: {},
				formFieldsMap: new Map(),
				hideComponentsMap: new Map(),
				needShowValueTags: ['asso-popup', 'mutiple-popup'],
				formData: {
					'F_Name': '',
					'F_Icon': null,
					'F_BriefIntroduction': '',
					'F_ClassHeading': [],
					'F_DataSceneClassification': [],
					'F_DataSources': '',
					'F_Free': '',
					'F_PayType': '',
					'F_PriceType': '',
					'F_BottomPrice': 0,
					'F_PeakPrice': 0,
					'F_DeliveryMethod': '',
					'F_Versions': '',
					'F_Url': '',
					'F_UseRequirement': '',
					'F_Status': '0',
					'F_Class':'',
					'F_Class': 1,
					'F_publisher': '',
					'F_publishAddress': "",
					'F_publishEmail': '',
					'F_publishUserName': '',
					'F_publishPhone': '',
					'F_ServiceProvider': '',
					'F_ServiceAddress': "",
					'F_ServiceEmail': '',
					'F_ServiceLinkMan': '',
					'F_ServicePhone': '',
					'F_ProviderProfile': '',
					'F_UserLicenseAgreement': null,
					'F_ConfidentialityAgreement': null,
					'F_APIDocument': null,
					'F_ErrorCodeReference': null,
					'F_ApplicationScenarioAttachment': null,
					'F_ApplicationScenario': '',
					'F_CommonProblemAttachment': null,
					'F_CommonProblem': '',
					'F_CommodityAgreement': '',
					'F_UrlType': "0",
				},
				rules: {
					F_Name: [{
						required: true,
						message: '请输入组件名称',
						trigger: 'blur'
					}],
					F_Icon: [{
						required: true,
						message: '组件图标不能为空',
						trigger: 'change'
					}],
					F_BriefIntroduction: [{
						required: true,
						message: '请输入组件简介',
						trigger: 'blur'
					}],
					F_ClassHeading: [{
						required: true,
						type: 'array',
						message: '请至少选择一个所属类目',
						trigger: 'change'
					}],
					F_DataSceneClassification: [{
						required: true,
						type: 'array',
						message: '请至少选择一个数据产品场景分类',
						trigger: 'change'
					}],
					F_DataSources: [{
						required: true,
						message: '请选择数据来源',
						trigger: 'change'
					}],
					F_Free: [{
						required: true,
						message: '请选择付费类型',
						trigger: 'change'
					}],
					F_PayType: [{
						required: true,
						message: '付费方式不能为空',
						trigger: 'change'
					}],
					F_PriceType: [{
						required: true,
						message: '价格类型不能为空',
						trigger: 'change'
					}],
					F_BottomPrice: [{
						required: true,
						message: '请输入价格区间',
						trigger: 'blur'
					}],
					F_PeakPrice: [{
						required: true,
						message: '请输入--',
						trigger: 'blur'
					}],
					F_DeliveryMethod: [{
						required: true,
						message: '请选择交付方式',
						trigger: 'change'
					}],
					F_Versions: [{
						required: true,
						message: '请输入数据产品版本',
						trigger: 'blur'
					}],
					F_Url: [{
						required: true,
						message: '请输入数据产品试用链接',
						trigger: 'blur'
					}],
					F_UseRequirement: [{
						required: true,
						message: '请输入数据产品使用要求',
						trigger: 'blur'
					}],
					F_publisher: [{
						required: true,
						message: '请输入发布商',
						trigger: 'blur'
					}],
					F_publishAddress: [{
						required: true,
						message: '请选择地区',
						trigger: 'change'
					}],
					F_publishEmail: [{
						required: true,
						message: '请输入邮箱',
						trigger: 'blur'
					}],
					F_publishUserName: [{
						required: true,
						message: '请输入联系人',
						trigger: 'blur'
					}],
					F_publishPhone: [{
						required: true,
						message: '请输入联系方式',
						trigger: 'blur'
					}],
					F_ServiceProvider: [],
					F_ServiceAddress: [],
					F_ServiceEmail: [],
					F_ServiceLinkMan: [],
					F_ServicePhone: [],
					F_ProviderProfile: [],
					F_UserLicenseAgreement: [],
					F_ConfidentialityAgreement: [],
					F_APIDocument: [],
					F_ErrorCodeReference: [],
					F_ApplicationScenarioAttachment: [],
					F_ApplicationScenario: [],
					F_CommonProblemAttachment: [],
					F_CommonProblem: [],
					F_CommodityAgreement: [{
						required: true,
						message: '请输入商品协议',
						trigger: 'blur'
					}],
				},
				F_UrlType: [{
					required: true,
					message: '请选择组件链接类型',
					trigger: 'change'
				}],
				tabsValue120: 'tab1',
				F_IconConfig: {
					"showTip": true,
					"fileSize": 2,
					"sizeUnit": "MB",
					"buttonText": "点击上传",
					"disabled": false,
					"accept": ".jpg, .jpeg, .png",
					"multiple": false,
				},
				F_DataSourcesOptions: [],
				F_FreeOptions: [],
				F_PayTypeOptions: [],
				F_PriceTypeOptions: [],
				F_DeliveryMethodOptions: [],
				F_UrlTypeOptions: [],
				F_StatusOptions: [],
				F_UserLicenseAgreementConfig: {
					"showTip": true,
					// "fileSize": 5,
					// "sizeUnit": "MB",
					"buttonText": "附件",
					"accept": ".pdf",
					"disabled": false
				},
				F_ConfidentialityAgreementConfig: {
					"showTip": true,
					// "fileSize": 5,
					// "sizeUnit": "MB",
					"buttonText": "附件",
					"accept": ".pdf",
					"disabled": false
				},
				F_APIDocumentConfig: {
					"showTip": true,
					// "fileSize": 5,
					// "sizeUnit": "MB",
					"buttonText": "附件",
					"accept": ".pdf",
					"disabled": false
				},
				F_ErrorCodeReferenceConfig: {
					"showTip": true,
					// "fileSize": 5,
					// "sizeUnit": "MB",
					"buttonText": "附件",
					"accept": ".pdf",
					"disabled": false
				},
				F_ApplicationScenarioAttachmentConfig: {
					"showTip": true,
					// "fileSize": 5,
					// "sizeUnit": "MB",
					"buttonText": "附件",
					"accept": ".pdf",
					"disabled": false
				},
				F_CommonProblemAttachmentConfig: {
					"showTip": true,
					// "fileSize": 5,
					// "sizeUnit": "MB",
					"buttonText": "附件",
					"accept": ".pdf",
					"disabled": false
				},
				F_ClassHeadingsettings: [{
					"level": 0,
					"name": "1",
					"dataSource": "f4e572123862966d338f79e749061383",
					"showField": "F_Name",
					"saveField": "F_Code"
				}, {
					"level": 1,
					"name": "2",
					"dataSource": "735c9532cddf702934c092ffd842b903",
					"showField": "F_Name",
					"saveField": "F_Code",
					"parentId": "F_ParentCode"
				}],
				F_DataSceneClassificationsettings: [{
					"level": 0,
					"name": "1",
					"dataSource": "2fef953f4205403a5196d29523e6d369",
					"showField": "F_Name",
					"saveField": "F_Code"
				}, {
					"level": 1,
					"name": "2",
					"dataSource": "735c9532cddf702934c092ffd842b903",
					"showField": "F_Name",
					"saveField": "F_Code",
					"parentId": "F_ParentCode"
				}],
			}
		},
		computed: {},
		watch: {
			'formData.F_BottomPrice': function(val, oldVal) {
				this.changeFormConfigDefaultValue();
			},
			'formData.F_PeakPrice': function(val, oldVal) {
				this.changeFormConfigDefaultValue();
			},
			tabsValue120(newValue){
				console.log(newValue)
			}
		},
		async created() {
			this.formConfig = this.getFormConfig();
			this.formFieldsMap = this.getFormFieldsMap();
			this.userInfo = localStorage.getItem("avue-userInfo") ? JSON.parse(localStorage.getItem(
				"avue-userInfo")).content : {};
		},
		async mounted() {
			
			this.hideComponentsMap = await this.getHideComponentsMap();
			this.showForm = false;
			await this.insertCreatedEvent();
			//TODO   再这里做数据回填 请求表单数据

			if (this.keyValue) {
				this.isAdd = false;
			}
			if (!this.isAdd && this.keyValue) {
				this.operationVal = 'edit';
				try {
					let res = await request({
						url: baseUrl + "/" + this.addressUrl + "/" + this.keyValue,
						method: "get",
					});
					this.formData = res.data.data
					if(res.data.data.F_Free == 1 ){
						this.F_PayType1 = false;
						this.F_PriceType1 = false;
						this.F_BottomPrice1 = false;
						this.F_PeakPrice1 = false;
					};
					if(res.data.data.F_PriceType == 1){
						this.F_BottomPrice1 = false;
						this.F_PeakPrice1 = false;
					}
					if (res.data.data.F_ClassHeading) {
						this.formData.F_ClassHeading = res.data.data.F_ClassHeading.split(',')
					} else {
						this.formData.F_ClassHeading = [];
					}

					if (res.data.data.F_DataSceneClassification) {
						this.formData.F_DataSceneClassification = res.data.data.F_DataSceneClassification.split(',')
					} else {
						this.formData.F_DataSceneClassification = [];
					}

					await this.handleEdit();
					this.showFormKey++;
				} catch (error) {}
			}


			if (typeof this.getField108Options == "function") {
				await this.getField108Options();
			}
			if (typeof this.getField109Options == "function") {
				await this.getField109Options();
			}
			if (typeof this.getField100Options == "function") {
				await this.getField100Options();
			}
			if (typeof this.getField110Options == "function") {
				await this.getField110Options();
			}
			if (typeof this.getField111Options == "function") {
				await this.getField111Options();
			}
			if (typeof this.getField115Options == "function") {
				await this.getField115Options();
			}
			if (typeof this.getField154Options == "function") {
				await this.getField154Options();
			}
			await this.insertMountedEvent();
			this.reRenderSubform = true; //子表单显示
			this.showFormKey++;
			this.processParameterAssignment();
			this.showForm = true;
		},
		methods: {
			getFormData() {
				let key = this.mainTableName + 'Entity';
				let returnParams = {};
				returnParams[key] = this.formData;
				return {
					...returnParams,
				};
			},
			changeValue(e){
				if(e == 1){
					this.F_PayType1 = false;
					this.rules.F_PayType[0].required = false;
					this.F_PriceType1 = false;
					this.rules.F_PriceType[0].required = false;
					this.F_BottomPrice1 = false;
					this.rules.F_BottomPrice[0].required = false;
					this.F_PeakPrice1 = false;
					this.rules.F_PeakPrice[0].required = false;
					this.F_UrlType1 = true;
				}
				else{
					this.F_PayType1 = true;
					this.F_PriceType1 = true;
					this.F_BottomPrice1 = true;
					this.F_PeakPrice1 = true;
					this.F_UrlType1 = false;
				}
			},
			changeValue2(e){
				// console.log(e)
				if(e == 1){
					this.F_BottomPrice1 = false;
					this.rules.F_BottomPrice[0].required = false;
					this.F_PeakPrice1 = false;
					this.rules.F_PeakPrice[0].required = false;
				}
				else{
					this.F_BottomPrice1 = true;
					this.F_PeakPrice1 = true;
				}
			}, 
			validateForm() {
				this.$refs['elForm'].validate(valid => {});
			},
			validateForm2() {
				this.$refs['tab11'].validate(valid => {});
			},
			validateForm3() {
				this.$refs['tab22'].validate(valid => {});
			},
			validateForm4() {
				this.$refs['tab33'].validate(valid => {});
			},
			
			async aysncValidateForm() {
				let validataArry = []
				let formValidateNotice = function formValidateNotice(obj, that, formAuth) {
					for (var o in obj) {
						if (!formAuth[o] && obj[o][0]) {
							that.$message({
								message: obj[o][0].message + ',' + that.$t('noFormAuth'),
								type: 'warning'
							});
							return;
						}
					}
				}
				validataArry.push(new Promise((resolve, reject) => {
					this.$refs['elForm'].validate((valid, object) => {
						if (!this.isWorkflowForm) formValidateNotice(object, this, this
							.formEnCodeList)
						resolve(valid)
					})
				}))
				let res = await Promise.all(validataArry)
				if (res.includes(false)) {
					return false
				} else {
					return true;
				}
			},
			async aysncValidateForm2() {
				let validataArry = []
				let formValidateNotice = function formValidateNotice(obj, that, formAuth) {
					for (var o in obj) {
						if (!formAuth[o] && obj[o][0]) {
							that.$message({
								message: obj[o][0].message + ',' + that.$t('noFormAuth'),
								type: 'warning'
							});
							return;
						}
					}
				}
				validataArry.push(new Promise((resolve, reject) => {
					this.$refs['tab11'].validate((valid, object) => {
						if (!this.isWorkflowForm) formValidateNotice(object, this, this
							.formEnCodeList)
						resolve(valid)
					})
				}))
				let res = await Promise.all(validataArry)
				if (res.includes(false)) {
					return false
				} else {
					return true;
				}
			},
			async aysncValidateForm3() {
				let validataArry = []
				let formValidateNotice = function formValidateNotice(obj, that, formAuth) {
					for (var o in obj) {
						if (!formAuth[o] && obj[o][0]) {
							that.$message({
								message: obj[o][0].message + ',' + that.$t('noFormAuth'),
								type: 'warning'
							});
							return;
						}
					}
				}
				validataArry.push(new Promise((resolve, reject) => {
					this.$refs['tab22'].validate((valid, object) => {
						if (!this.isWorkflowForm) formValidateNotice(object, this, this
							.formEnCodeList)
						resolve(valid)
					})
				}))
				let res = await Promise.all(validataArry)
				if (res.includes(false)) {
					return false
				} else {
					return true;
				}
			},
			async aysncValidateForm4() {
				let validataArry = []
				let formValidateNotice = function formValidateNotice(obj, that, formAuth) {
					for (var o in obj) {
						if (!formAuth[o] && obj[o][0]) {
							that.$message({
								message: obj[o][0].message + ',' + that.$t('noFormAuth'),
								type: 'warning'
							});
							return;
						}
					}
				}
				validataArry.push(new Promise((resolve, reject) => {
					this.$refs['tab33'].validate((valid, object) => {
						if (!this.isWorkflowForm) formValidateNotice(object, this, this
							.formEnCodeList)
						resolve(valid)
					})
				}))
				let res = await Promise.all(validataArry)
				if (res.includes(false)) {
					return false
				} else {
					return true;
				}
			},
			
			changeTableData() {
				if (this.formData.F_ClassHeading instanceof Array) this.formData.F_ClassHeading = this.formData
					.F_ClassHeading
					.join(',')
				if (this.formData.F_DataSceneClassification instanceof Array) this.formData.F_DataSceneClassification =
					this.formData.F_DataSceneClassification
					.join(',')
			},
			async submitForm() {
				this.submitLoading = true;
				let valid = await this.aysncValidateForm();
				if (valid == false) {
					this.submitLoading = false;
					return false;
				}
				this.changeTableData();
				//格式化数据
				let newObj = this.getFormData();

				//如果没有传入参数就是新增
				if (!this.keyValue) {

					request({
						url: baseUrl + "/" + this.addressUrl,
						method: "post",
						data: newObj
					}).then((res) => {
						this.submitLoading = false;
						this.$notify({
							title: "成功",
							message: "新增成功",
							type: "success",
						});
						this.$emit("onChange", true)
					});

				} else {

					request({
						url: baseUrl + "/" + this.addressUrl + "/" + this.keyValue,
						method: "put",
						data: newObj
					}).then((res) => {
						this.submitLoading = false;
						this.$notify({
							title: "成功",
							message: "修改成功",
							type: "success",
						});
						this.$emit("onChange", true)
					});

				}




				await this.handleSubmit();
			},
			 async nextstep(){
				let valid2 = await this.aysncValidateForm2();
				let valid3 = await this.aysncValidateForm3();
				let valid4 = await this.aysncValidateForm4();
				// if (valid2 == false) {
				// 	this.$notify({
				// 	  title: "失败",
				// 	  message: "表单未填写完整",
				// 	  type: "warning",
				// 	});
				// 	return false;
				// }
				if(this.tabsValue120 == "tab1"){
					if (valid2 == true) {
						this.tabsValue120 = "tab2"
						this.prevstep1 = true
						this.nextstep1 = true
					}
					else{
						this.$notify({
						  title: "失败",
						  message: "表单未填写完整",
						  type: "warning",
						});
						return false;
					}
				}
				else if(this.tabsValue120 == "tab2"){
					if(valid3 == true){
						this.tabsValue120 = "tab3"
						this.prevstep1 = true
						this.nextstep1 = true
					}
					else{
						this.$notify({
						  title: "失败",
						  message: "表单未填写完整",
						  type: "warning",
						});
						return false;
					}
					
				}
				else if(this.tabsValue120 == "tab3"){
					if(valid4 == true){
						this.tabsValue120 = "tab4"
						this.submit1 = true
						this.nextstep1 = false
						this.prevstep1 = true
					}
					else{
						this.$notify({
						  title: "失败",
						  message: "表单未填写完整",
						  type: "warning",
						});
						return false;
					}
				}
				// else if(this.tabsValue120 == "tab4"){
				// 	this.tabsValue120 = "tab5"
				// 	this.submit1 = true
				// 	this.nextstep1 = false
				// 	this.prevstep1 = true
				// }
			},
			prevstep(){
				// if(this.tabsValue120 == "tab5"){
				// 	this.tabsValue120 = "tab4"
				// 	this.submit1 = false
				// 	this.prevstep1 = true
				// }
				if(this.tabsValue120 == "tab4"){
					this.tabsValue120 = "tab3"
					this.submit1 = false
					this.prevstep1 = true
					this.nextstep1 = true
					
				}
				else if(this.tabsValue120 == "tab3"){
					this.tabsValue120 = "tab2"
					this.submit1 = false
					this.nextstep1 = true
					
				}
				else if(this.tabsValue120 == "tab2"){
					this.tabsValue120 = "tab1"
					this.prevstep1 = false
					this.nextstep1 = true
				}
			},
			cancelForm() {
				this.$emit("onChange", true)
			},
			formatTree(data, valueField, lableField, childField, type) {
				let tree = [];
				data.forEach((node, index) => {
					let newNode = {
						value: node[valueField],
						label: node[lableField],
					};
					if (type) {
						newNode.disabled = node[valueField] == undefined ? true : false
					}
					tree.push(newNode);
					if (node[childField] != null && node[childField].length > 0) {
						newNode.children = (this.formatTree(node[childField], valueField, lableField, childField,
							type));
					}
				}, this);
				return tree;
			},

			//辅助编辑 预留方法
			async handleEdit() {
				await this.insertEditEvent();
			},

			//FORM_EVENT_EDIT

			//辅助提交 预留方法
			async handleSubmit() {
				await this.insertSubmitEvent();
			},
			//辅助工作流提交 预留方法
			getHandleSubmitFormEvent() {

			},
			//辅助工作流表单事件 判断 表单事件是否已经执行过
			getisExecutedFormEvent() {
				let key = 'index' + this.$store.state.formParser.workflowFormTabIndexKey;
				return this.$store.state.formParser.isExecutedFormEvent[key] ? this.$store.state.formParser
					.isExecutedFormEvent[key] : false;

			},

			getNumberFixed2(number) {
				let splitNum = ("" + number).replace(/(^0*)/g, "").split(".");
				let num = splitNum[0] == "" ? '0' : splitNum[0];
				if (splitNum.length > 1) {
					num += '.';
					let roundNum = 2; //保留两位小数
					for (let i = 0; i < roundNum; i++) {
						num += splitNum[1][i];
					}
				}
				return parseFloat(num);
			},
			changeFormConfigDefaultValue() {
				let valueForFormIdMap = new Map();
				this.formConfig.fields.forEach((ele) => {
					if (ele.__config__.componentName == "table") {
						ele.__config__.children.forEach((element) => {
							valueForFormIdMap.set(ele.__config__.formId + "-table-" + element.__config__
								.formId,
								element.__config__.defaultValue);
						});
					} else if (ele.__config__.componentName && ele.__config__.componentName == 'avue-tabs') {
						let childrenObj = ele.__config__.childrenObj || {};
						let _arr = this.getValByTabs(childrenObj);
						_arr.map(item => {
							valueForFormIdMap.set(item.formId, item.defaultValue);
						});
					} else {
						valueForFormIdMap.set(ele.__config__.formId, this.formData[ele.__vModel__]);
					}
				});
				this.formConfig.fields.forEach((ele, index) => {
					if (ele.__config__.componentName == "table") {
						ele.__config__.children.forEach((element, childrenIndex) => {
							let defaultValue = 0;
							if (element.computationalConfiguration && element.computationalConfiguration
								.length > 0) {
								let formulaStr = "";
								element.computationalConfiguration.forEach((item) => {
									if (item.type == "taxRate") {
										//税率
										if (element.taxRate >= 0) {
											formulaStr += element.taxRate * 0.01;
										}
									} else {
										let eleValue = valueForFormIdMap.get(item.formId) || 0;
										formulaStr += item.formId == 0 ? item.name : eleValue;
									}
								});
								defaultValue = eval(formulaStr) * 100;
								defaultValue = this.getNumberFixed2(defaultValue) / 100;
								//大写
								if (element.isCapitalized) {
									this.formConfig.fields[index].__config__.children[childrenIndex]
										.__config__
										.capitalizedValue = this.getCapitalizedMethod(defaultValue);
								}
								this.formConfig.fields[index].__config__.children[childrenIndex].__config__
									.defaultValue = defaultValue;
								this.formData[element.__vModel__] = defaultValue;
							}
						});
					} else if (ele.__config__.componentName && ele.__config__.componentName == 'avue-tabs') {
						let childrenObj = ele.__config__.childrenObj || {};
						//avue-tabs
						this.calcDefaultValueByTabs(ele.__config__.childrenObj, valueForFormIdMap);
					} else {
						let defaultValue = 0;
						if (ele.computationalConfiguration && ele.computationalConfiguration.length > 0) {
							let formulaStr = "";
							ele.computationalConfiguration.forEach((item) => {
								if (item.type == "taxRate") {
									//税率
									if (ele.taxRate >= 0) {
										formulaStr += ele.taxRate * 0.01;
									}
								} else {
									let eleValue = valueForFormIdMap.get(item.formId) || 0;
									formulaStr += item.formId == 0 ? item.name : eleValue;
								}
							});
							defaultValue = eval(formulaStr) * 100;
							defaultValue = this.getNumberFixed2(defaultValue) / 100;
							//大写
							if (ele.isCapitalized) {
								this.formConfig.fields[index].__config__.capitalizedValue = this
									.getCapitalizedMethod(
										defaultValue);
							}
							this.formConfig.fields[index].__config__.defaultValue = defaultValue;
							this.formData[ele.__vModel__] = defaultValue;
						}
					}
				});
			},
			getValByTabs(childrenObj) {
				let _arr = [];
				if (!childrenObj || !(childrenObj instanceof Object)) return [];
				for (let key in childrenObj) {
					let children = childrenObj[key];
					children.map(item => {
						if (item.__config__.componentName && item.__config__.componentName == 'avue-tabs') {
							let cObj = item.__config__.childrenObj || {};
							_arr.push(...this.getValByTabs(item.__config__.childrenObj));
						} else {
							let _obj = {};
							_obj.formId = item.__config__.formId;
							_obj.defaultValue = this.formData[item.__vModel__];
							_arr.push(_obj);
						}
					});
				}
				return (() => {
					return _arr;
				})()
			},
			calcDefaultValueByTabs(childrenObj, valueForFormIdMap) {
				if (!childrenObj || !(childrenObj instanceof Object)) return;
				for (let key in childrenObj) {
					let children = childrenObj[key];
					children.map(item => {
						if (item.__config__.componentName && item.__config__.componentName == 'avue-tabs') {
							let cObj = item.__config__.childrenObj || {};
							this.calcDefaultValueByTabs(cObj, valueForFormIdMap);
						} else {
							let defaultValue = 0;
							if (item.computationalConfiguration && item.computationalConfiguration.length > 0) {
								let formulaStr = "";
								item.computationalConfiguration.forEach((c) => {
									if (c.type == "taxRate") {
										//税率
										if (item.taxRate >= 0) {
											formulaStr += item.taxRate * 0.01;
										}
									} else {
										let eleValue = valueForFormIdMap.get(c.formId) || 0;
										formulaStr += c.formId == 0 ? c.name : eleValue;
									}
								});
								defaultValue = eval(formulaStr) * 100;
								defaultValue = this.getNumberFixed2(defaultValue) / 100;
								item.__config__.defaultValue = defaultValue;
								this.formData[item.__vModel__] = defaultValue;
							}
						}
					});
				}
			},
			async getField108Options() {
				// 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
				try {
					let resp = await this.$axios({
						method: 'get',
						url: baseUrl + '/data-items/SubassemblyDataSources/detail',
					});
					if (resp.data.data) {
						this.F_DataSourcesOptions = resp.data.data;
					}
				} catch (error) {}
			},
			async getField109Options() {
				// 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
				try {
					let resp = await this.$axios({
						method: 'get',
						url: baseUrl + '/data-items/SubassemblyFree/detail',
					});
					if (resp.data.data) {
						this.F_FreeOptions = resp.data.data;
					}
				} catch (error) {}
			},
			async getField110Options() {
				// 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
				try {
					let resp = await this.$axios({
						method: 'get',
						url: baseUrl + '/data-items/SubassemblyPayType/detail',
					});
					if (resp.data.data) {
						this.F_PayTypeOptions = resp.data.data;
					}
				} catch (error) {}
			},
			async getField111Options() {
				// 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
				try {
					let resp = await this.$axios({
						method: 'get',
						url: baseUrl + '/data-items/SubassemblyPriceType/detail',
					});
					if (resp.data.data) {
						this.F_PriceTypeOptions = resp.data.data;
					}
				} catch (error) {}
			},
			async getField115Options() {
				// 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
				try {
					let resp = await this.$axios({
						method: 'get',
						url: baseUrl + '/data-items/SubassemblyDeliveryMethod/detail',
					});
					if (resp.data.data) {
						this.F_DeliveryMethodOptions = resp.data.data;
					}
				} catch (error) {}
			},
			async getField154Options() {
				// 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
				try {
					let resp = await this.$axios({
						method: 'get',
						url: baseUrl + '/data-items/SubassemblyStatus/detail',
					});
					if (resp.data.data) {
						this.F_StatusOptions = resp.data.data;
					}
				} catch (error) {}
			},
			async triggerEventHandler(eventData) {
				if (eventData.length > 0) {
					eventData.forEach(ele => {
						let functionName = 'getField' + ele.componentFormId + 'Options';
						if (typeof this[functionName] == "function") {
							this[functionName]();
						}
					})
				}
			},
			 async getField100Options() {
			      // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
			      try {
			        let resp = await this.$axios({
			          method: 'get',
			          url: baseUrl + '/data-items/SubassemblyUrlType/detail',
			        });
			        if (resp.data.data) {
			          this.F_UrlTypeOptions = resp.data.data;
			        }
			      }
			      catch (error) {}
			    },
			triggerEventFormIdHandler(formId) {
				if (this.formFieldsMap.get(formId).__config__.triggerEvents && this.formFieldsMap.get(formId).__config__
					.triggerEvents.length > 0) {
					this.formFieldsMap.get(formId).__config__.triggerEvents.forEach(triggerEventItem => {
						if (this.formFieldsMap.get(formId).__config__.triggerEventData && this.formFieldsMap.get(
								formId)
							.__config__.triggerEventData[triggerEventItem] && this.formFieldsMap.get(formId)
							.__config__
							.triggerEventData[triggerEventItem].length > 0) {
							this.triggerEventHandler(this.formFieldsMap.get(formId).__config__.triggerEventData[
								triggerEventItem]);
						}
					});
				}
				return true;
			},
			//清空联想弹层、多选弹层的值
			clearBombLayerFormData(filed) {
				this.formData[filed] = '';
				this.formData[filed + '_showValue'] = '';
			},
			// 流程参数赋值
			processParameterAssignment() {
				// 流程中的流程参数赋值 优先级最高，最后赋值
				setTimeout(() => {
					if (this.isEdit != 2 && this.parameter && this.parameter[this.mainTableName]) {
						this.showForm = false;
						for (let [key, value] of Object.entries(this.parameter[this.mainTableName])) {
							this.setFormDataValue(key, value);
						}
						this.showForm = true;
					}
				}, 0);
			},
			setFormDataValue(field, val) {
				if (Array.isArray(this.formData[field])) {
					if (val.includes(',')) {
						this.formData[field] = val.split(',');
					} else {
						this.formData[field] = [val];
					}
				} else {
					this.formData[field] = val;
				}
				//处理联想弹层，多选弹层
				if (this.formData[field + '_showValue'] != undefined) {
					this.formData[field + '_showValue'] = val;
				}
			},
			setOutputsValue(nodeType, formId, res, outputKey) {
				let nodeTypeChecked = false;
				if (nodeType == 'created') {
					nodeTypeChecked = this.operationVal == 'add';
				} else if (nodeType == 'edit') {
					nodeTypeChecked = this.operationVal == 'edit';
				} else if (nodeType == 'mounted') {
					nodeTypeChecked = this.operationVal == 'add' || this.operationVal == 'edit';
				}
				if (nodeTypeChecked && this.disabled != true && res && res.data && res.data.data && this.formFieldsMap
					.has(formId) && this.formFieldsMap.get(formId).__vModel__ && this.formData.hasOwnProperty(this
						.formFieldsMap.get(formId).__vModel__)) {
					this.setFormDataValue(this.formFieldsMap.get(formId).__vModel__, res.data.data[outputKey]);
					// 联想弹层 多选弹层 特殊处理
					if (this.formFieldsMap.get(formId).__config__ && this.formFieldsMap.get(formId).__config__.avueType &&
						this.needShowValueTags.includes(this.formFieldsMap.get(formId).__config__.avueType)) {
						this.formData[this.formFieldsMap.get(formId).__vModel__ + '_showValue'] = res.data.data[outputKey];
					}
					this.triggerEventFormIdHandler(formId);
				}
			},
			//子表单权限
			getAuthorityTableChildrenList(bindTable, children) {
				let column = [];
				if (bindTable && this.formEnCodeList && this.formEnCodeList[bindTable]) {
					let formSubEnCodeList = this.formEnCodeList[bindTable];
					if (children && children.length > 0) {
						column = children.map(ele2 => {
							if (formSubEnCodeList.includes(ele2.prop)) {
								ele2.hide = false;
							} else {
								ele2.hide = true;
							}
							if (ele2.hide == false) {
								//工作流中系统表单必填权限
								if (this.formSubTableNotRequiredList && this.formSubTableNotRequiredList[
									bindTable] !=
									undefined) {
									if (this.formSubTableNotRequiredList[bindTable].includes(ele2.prop)) {
										ele2.required = false;
									} else {
										ele2.required = true;
									}
								}
								ele2.rules = [];
								if (ele2.required) {
									ele2.rules = ele2.ruleList;
								}
								// disabled 属性
								if (this.formSubTableDisabledList && this.formSubTableDisabledList[bindTable] !=
									undefined) {
									if (this.formSubTableDisabledList[bindTable].includes(ele2.prop)) {
										ele2.disabled = true;
									} else {
										ele2.disabled = false;
									}
								}
								if (this.disabled) { //查看
									ele2.disabled = true;
								}
							} else {
								ele2.rules = []
								if (ele2.required) {
									ele2.ruleList.forEach(el => {
										el.message += ',' + this.$t('noFormAuth')
									})
									ele2.rules = ele2.ruleList;
								}
							}
							return ele2;
						});
					}
					return column;
				} else {
					return children;
				}
			},
			async insertCreatedEvent() {

			},
			async insertMountedEvent() {

			},
			async insertEditEvent() {

			},
			async insertSubmitEvent() {

			},
			getFormConfig() {
				return fieldsConfig();
			},
			getFormFieldsMap() {
				return formFieldsMap();
			},
			async getHideComponentsMap() {
				let mapList = new Map();
				let hideComponentList = this.getHideComponents();
				if (typeof this.initHideComponentList == 'function') {
					mapList = await this.initHideComponentList(hideComponentList);
					this.$store.commit("SET_HIDE_COMPONENT_LIST", mapList);
				}
				return mapList;
			},
			getHideComponentsMapItem(key) {
				if (this.hideComponentsMap.size > 0) {
					return this.hideComponentsMap.has(key) ? this.hideComponentsMap.get(key) : "";
				} else {
					return ""
				}
			},
			getHideComponents() {
				return getHideComponents();
			},
		}
	}
</script>
<style>
	.el-table__empty-block {
		width: 100% !important;
	}

	.avue-form__row {
		padding: 0 !important;
	}

	#editorphone {
		width: 375px;
		margin: 0 auto;
		border: 1px solid #E4E7ED;
		padding: 0 7.5px;
		background: #f5f6fa;
		height: 700px;
		overflow-y: auto;
		overflow-x: hidden;
		border-radius: 5px;
	}

	#editorphone .el-col {
		border-bottom: 1px solid #F2F2F2;
		background: #fff;
		margin-bottom: 0;
		padding: 0 15px 6px !important;
		width: 100%;
	}

	#editorphone .el-form-item__label {
		line-height: 20px
	}

	#editorphone .el-input-group .el-input__inner {
		background: #f5f6fa
	}

	#editorphone .el-input__inner {
		border: 0
	}

	#editorphone .el-input-group__append,
	#editorphone .el-input-group__prepend {
		border: 0;
		background: #edeef2;
		color: #666;
	}

	#editorphone .el-input-group .el-input__prefix {
		left: 44px
	}

	#editorphone .el-input-group .el-input__suffix {
		right: 44px
	}

	#editorphone .el-form-item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		flex-flow: wrap;
	}

	#editorphone .el-form-item__label {
		float: none;
		min-width: 85px;
		width: auto !important;
		text-align: left;
		flex: auto;
	}

	#editorphone .tinymce .el-form-item__label {
		min-width: 100%;
	}

	#editorphone .el-form-item__content {
		margin-left: 0px !important;
		flex: auto;
		width: calc(100% - 95px);
	}

	#editorphone .avueFormNoLable .el-form-item__label,
	#editorphone .avueFormNoLable .avue-crud__pagination {
		display: none;
	}

	#editorphone .avueFormNoLable .el-collapse-item__wrap,
	#editorphone .avueFormNoLable .el-collapse {
		border-bottom: 0
	}

	#editorphone .avueFormNoLable .el-col {
		border-bottom: 0;
		padding-bottom: 0
	}

	#editorphone .el-form-item__content .el-button:first-child {
		margin-left: 90px;
	}

	.el-upload__tip {
		line-height: 1.2;
	}
	/* 禁用点击事件 */
	/* .el-tabs__item {
	  pointer-events: none;
	} */
</style>
